<#import "../../../common/layout.ftl" as l>


<@l.content>

<script>
    var shipId = '<#if shipInfo??>${shipInfo.shipid}</#if>';

    var crud = {
        read: "/manage/ship/communication/detail",
        update: '/manage/ship/communication/update',
        del: "/manage/ship/communication/delete"
    };

    var model = [
        {name : 'id',type : 'hidden',text : '编号',allowBlank : true,primaryKey : true},
        {name : 'shipid',type : 'select',text : '船舶',value:shipId,allowBlank : false,primaryKey : false,options : {
        url : "/manage/ship/ajax/list",
                displayField : "shipName",
                valueField : "shipid"
         }},
        {name : 'communicateType',type : 'text',text : '通联方式',allowBlank : false,primaryKey : false},
        {name : 'communicateNumber',type : 'text',text : '通联号码',allowBlank : false,primaryKey : false},
        {name : 'communicatePerson',type : 'text',text : '通联人员/值班人员',allowBlank : false,primaryKey : false}
    ];
</script>


<form id="pagination-form" method="post">
    <input type="hidden" name="shipid" value="<#if param.shipid??>${param.shipid}<#else></#if>">
    <input type="hidden" name="page" value="${pageInfo.pageNum}">
    <input type="hidden" name="limit" value="${pageInfo.pageSize}">
    <input type="hidden" name="totalPage" value="${pageInfo.pages}">
    <div class="ibox">
        <div class="ibox-title">
            <h5>通联信息<#if shipInfo.shipName??>-${shipInfo.shipName}<#else></#if></h5>

            <div class="ibox-tools">
                <a href="/manage/ship/list" >
                    <i class="fa fa-reply"></i>
                    返回
                </a>
                <a href="#" id="pagination-add">
                    <i class="fa fa-plus"></i>
                    添加
                </a>
                <a id="pagination-edit" href="#">
                    <i class="fa fa-edit"></i>
                    编辑
                </a>

                <a id="pagination-delete" href="#">
                    <i class="fa fa-trash"></i>
                    删除
                </a>

            </div>
        </div>
        <div class="ibox-content">
            <div class="input-group search-content">
                <input type="text" name="shipName" value="<#if param.shipName??>${param.shipName}<#else></#if>" class="form-control"> <span class="input-group-btn">
                <input type="submit" class="btn btn-primary" value="搜索">
            </span></div>
            <div>
                <div class="table-responsive">
                    <table class="table table-striped table-hover dataTables-example" >
                        <thead>
                        <tr>
                            <th>&nbsp;</th>
                            <th>通联人员/值班人员</th>
                            <th>通联方式</th>
                            <th>通联号码</th>
                        </tr>
                        </thead>

                        <tbody>
                            <#list pageInfo.list as report>
                            <tr>
                                <td><input type="checkbox" class="i-checks" value="<#if report.id??>${report.id}<#else></#if>"></td>
                                <td><a href="#" onclick="pagination.editItem('<#if report.id??>${report.id}<#else></#if>')"><#if report.communicatePerson??>${report.communicatePerson}<#else></#if></a></td>
                                <td><#if report.communicateType??>${report.communicateType}<#else></#if></td>
                                <td><#if report.communicateNumber??>${report.communicateNumber}<#else></#if></td>
                            </tr>
                            </#list>
                        </tbody>


                    </table>
                </div>
                <div class="pagination-content">
                    <div id="pagination" class="pagination">
                    </div>
                </div>
            </div>
        </div>

    </div>
</form>


</@l.content>

<script src="/pagination/js/pagination.js"></script>
